home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
2336A.ZIP
/
SCRDISK1.EXE
/
arc
/
SKELETON.P
< prev
next >
Wrap
Text File
|
1990-03-04
|
5KB
|
203 lines
{----------------------------------------------------------------------------
Turbo ScrEdit Skeleton v.1.0
for Turbo Pascal 4.0, 5.0, 5.5
Refer to TURBO SCREDIT TUTOR - PART 2 for a complete discussion on how
this file is to be used.
----------------------------------------------------------------------------}
{---**Version**---}
{---**Buffers**---}
{----**User Variables**----}
Var
Load_Screen_No : Integer;
Demo_Screen_Pointer : Byte;
Demo_Mode,
Demo_Current_Screen : Integer;
{----** Example of loading and displaying screens**----}
Procedure Load_Screen;
Begin
S_Num := 0;
Repeat
Demo_Screen_Pointer := Demo_Screen_Pointer + 1;
Case Demo_Screen_Pointer of
{---**Screens**---}
Else
Demo_Screen_Pointer := 0;
End;{Case Of}
Until S_Num > 0;
S_UserMsg := '<F1> change screen <ESC> exit Press special keys for demo ';
End;
Procedure Initialize_Program;
Begin
{---**ScreenFileName**---};
{---**InitRoutines**---}
{---**System Switches**----}
S_ErrorSound := True;
S_ErrorFreq := 300;
S_ErrorDur := 50;
S_ErrorBg := Red;
S_ErrorFg := Yellow;
S_HelpSound := True;
S_HelpFreq := 200;
S_HelpDur := 50;
S_HelpBg := Blue;
S_HelpFg := Cyan;
S_UserSound := True;
S_UserFreq := 100;
S_UserDur := 50;
S_UserBg := Black;
S_UserFg := White;
S_UserMsg := '';
S_ShowStatus := True;
S_StBg := Black;
S_StFg := Green;
S_StLabelBg := LightGray;
S_StLabelFg := Black;
S_EnterAsTab := False;
S_AutoHelp := False;
S_AutoValidate := False;
S_Cursor := S_Normal;
S_Point := 0;
{----** 1st Example Code **----}
Demo_Screen_Pointer := 0;
Demo_Mode := 1;
Load_Screen;
End;
Procedure Process_Screen_File;
Begin
{----** Demo mode 1 - Full Screen Mode **----}
If (Demo_Mode = 1) Then
S_ReadScreen;
{----** Demo mode 2 - Individule Field Mode **----}
If Demo_Mode = 2 Then
Repeat
S_Point := S_Point + 1;
While (S_Point = 0) Or (S_Field^.S_Type[S_Point] > 9) Do
Begin
S_Point := S_Point + 1;
If S_Point > S_Indx^.S_Count[S_Num] Then
S_Point := 0;
End;
If S_UserMsg = '' Then
Begin
Str(S_point:3,S_UserMsg);
S_UserMsg := 'Field <' + S_UserMsg+ '>';
End;
S_READFIELD;
Until (S_Alt) Or (S_Ctrl) Or (S_Fkey) Or (S_Enter);
{----** Example code for demonstration mode **----}
If (S_F1) Then
Begin
S_UserMsg := 'Press any key to load the next screen';
S_ReadKey;
Load_Screen;
End;
{----**Special Key Testing**----}
If (S_FKey) And (Not S_F1) Then
Begin
S_UserMsg := '< >';
If S_Ch > #00 Then S_UserMsg[2] := S_Ch;
If S_ScrollLock Then S_UserMsg := S_UserMsg + '<Scroll Lock>';
If S_NumLock Then S_UserMsg := S_UserMsg + '<Num Lock>';
If S_Caps Then S_UserMsg := S_UserMsg + '<Caps>';
If S_InsertMode Then S_UserMsg := S_UserMsg + '<Insert Mode>';
If S_LeftShift Then S_UserMsg := S_UserMsg + '<Left Shift>';
If S_RightShift Then S_UserMsg := S_UserMsg + '<Right Shift>';
If S_Alt Then S_UserMsg := S_UserMsg + '< Alt >';
If S_Ctrl Then S_UserMsg := S_UserMsg + '< Ctrl >';
If S_Esc Then S_UserMsg := S_UserMsg + '<Escape>';
If S_F1 Then S_UserMsg := S_UserMsg + '<F1>';
If S_F2 Then S_UserMsg := S_UserMsg + '<F2>';
If S_F3 Then S_UserMsg := S_UserMsg + '<F3>';
If S_F4 Then S_UserMsg := S_UserMsg + '<F4>';
If S_F5 Then S_UserMsg := S_UserMsg + '<F5>';
If S_F6 Then S_UserMsg := S_UserMsg + '<F6>';
If S_F7 Then S_UserMsg := S_UserMsg + '<F7>';
If S_F8 Then S_UserMsg := S_UserMsg + '<F8>';
If S_F9 Then S_UserMsg := S_UserMsg + '<F9>';
If S_F10 Then S_UserMsg := S_UserMsg + '<F10>';
If S_F11 Then S_UserMsg := S_UserMsg + '<F11>';
If S_F12 Then S_UserMsg := S_UserMsg + '<F12>';
If S_Home Then S_UserMsg := S_UserMsg + '<Home>';
If S_End Then S_UserMsg := S_UserMsg + '<End>';
If S_PgUp Then S_UserMsg := S_UserMsg + '<PgUp>';
If S_PgDn Then S_UserMsg := S_UserMsg + '<PgDn>';
If S_Left Then S_UserMsg := S_UserMsg + '<Left>';
If S_Right Then S_UserMsg := S_UserMsg + '<Right>';
If S_Up Then S_UserMsg := S_UserMsg + '<Up>';
If S_Down Then S_UserMsg := S_UserMsg + '<Down> ';
If S_Ins Then S_UserMsg := S_UserMsg + '<Insert>';
If S_Del Then S_UserMsg := S_UserMsg + '<Delete>';
If S_Tab Then S_UserMsg := S_UserMsg + '<Tab>';
If S_BkSp Then S_UserMsg := S_UserMsg + '<BkSp>';
If S_ENTER Then S_UserMsg := S_UserMsg + '<Enter>';
End;
End;
Begin
Initialize_Program;
While (Not S_Esc) Do Process_Screen_File;
{----** Closing the Screen file **----};
S_CloseScreenFile;
End.